#ifndef __PG_CUSTOM_PATHLIST_HOOK_H__
#define __PG_CUSTOM_PATHLIST_HOOK_H__

#include "pg_filter_common.h"
#include "share_mem.h"

typedef struct PGCustomScanState_s {
        CustomScanState		css;
	RelOptInfo              *baserel;
	HeapTupleData   	c_tuple;
	tupdesc_t		tupdesc;
	filter_t 		filter;
        qual_t 			qual;
	int			max_attr_index;
	int			filter_cnt;
	char			filepath[128];
	int			blk_cnt;
	int			file_cnt;
        share_mem_data_t 	*share_mem;
        mem_blk_t       	*mem_blk;
	int 			conn;
	int			request_cnt;
	int			respond_cnt;
	int			blk_tuple_cnt;	
	int			total_tuple_cnt;	
	int			blk_index;
	int			tup_index;
} PGCustomScanState;

/*FpgaCustomScan Copy from PostgreSQL Kernel add rel in CustomScan*/
typedef struct FpgaCustomScan
{
        Scan            scan;
        uint32          flags;                  /* mask of CUSTOMPATH_* flags, see
                                                                 * nodes/extensible.h */
        List       *custom_plans;       /* list of Plan nodes, if any */
        List       *custom_exprs;       /* expressions that custom code may evaluate */
        List       *custom_private; /* private data for custom code */
        List       *custom_scan_tlist;  /* optional tlist describing scan tuple */
        Bitmapset  *custom_relids;      /* RTIs generated by this scan */
        const struct CustomScanMethods *methods;

	//Add for CustomScan
	RelOptInfo* rel;
} FpgaCustomScan;

void PGSetCustomRelPathlistHook (PlannerInfo* root,
                               RelOptInfo* rel,
                               Index rti,
                               RangeTblEntry* rte);
#endif
